3.3.81 \(\int \cos (c+d x) (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx\) [281]

Optimal. Leaf size=35 \[ (A b+a B) x+\frac {b B \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a A \sin (c+d x)}{d} \]

[Out]

(A*b+B*a)*x+b*B*arctanh(sin(d*x+c))/d+a*A*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {4081, 3855} \begin {gather*} x (a B+A b)+\frac {a A \sin (c+d x)}{d}+\frac {b B \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(a + b*Sec[c + d*x])*(A + B*Sec[c + d*x]),x]

[Out]

(A*b + a*B)*x + (b*B*ArcTanh[Sin[c + d*x]])/d + (a*A*Sin[c + d*x])/d

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4081

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(B_.)
 + (A_)), x_Symbol] :> Simp[A*a*Cot[e + f*x]*((d*Csc[e + f*x])^n/(f*n)), x] + Dist[1/(d*n), Int[(d*Csc[e + f*x
])^(n + 1)*Simp[n*(B*a + A*b) + (B*b*n + A*a*(n + 1))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B},
 x] && NeQ[A*b - a*B, 0] && LeQ[n, -1]

Rubi steps

\begin {align*} \int \cos (c+d x) (a+b \sec (c+d x)) (A+B \sec (c+d x)) \, dx &=\frac {a A \sin (c+d x)}{d}-\int (-A b-a B-b B \sec (c+d x)) \, dx\\ &=(A b+a B) x+\frac {a A \sin (c+d x)}{d}+(b B) \int \sec (c+d x) \, dx\\ &=(A b+a B) x+\frac {b B \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a A \sin (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 46, normalized size = 1.31 \begin {gather*} A b x+a B x+\frac {b B \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a A \cos (d x) \sin (c)}{d}+\frac {a A \cos (c) \sin (d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(a + b*Sec[c + d*x])*(A + B*Sec[c + d*x]),x]

[Out]

A*b*x + a*B*x + (b*B*ArcTanh[Sin[c + d*x]])/d + (a*A*Cos[d*x]*Sin[c])/d + (a*A*Cos[c]*Sin[d*x])/d

________________________________________________________________________________________

Maple [A]
time = 0.21, size = 48, normalized size = 1.37

method result size
derivativedivides \(\frac {A \sin \left (d x +c \right ) a +B a \left (d x +c \right )+A b \left (d x +c \right )+B b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(48\)
default \(\frac {A \sin \left (d x +c \right ) a +B a \left (d x +c \right )+A b \left (d x +c \right )+B b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(48\)
risch \(A b x +B a x -\frac {i A a \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i A a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B b}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B b}{d}\) \(83\)
norman \(\frac {\left (-A b -B a \right ) x +\left (A b +B a \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {2 A a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 A a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {B b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {B b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) \(136\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a+b*sec(d*x+c))*(A+B*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(A*sin(d*x+c)*a+B*a*(d*x+c)+A*b*(d*x+c)+B*b*ln(sec(d*x+c)+tan(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 58, normalized size = 1.66 \begin {gather*} \frac {2 \, {\left (d x + c\right )} B a + 2 \, {\left (d x + c\right )} A b + B b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, A a \sin \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))*(A+B*sec(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(2*(d*x + c)*B*a + 2*(d*x + c)*A*b + B*b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 2*A*a*sin(d*x +
 c))/d

________________________________________________________________________________________

Fricas [A]
time = 3.72, size = 54, normalized size = 1.54 \begin {gather*} \frac {2 \, {\left (B a + A b\right )} d x + B b \log \left (\sin \left (d x + c\right ) + 1\right ) - B b \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, A a \sin \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))*(A+B*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(2*(B*a + A*b)*d*x + B*b*log(sin(d*x + c) + 1) - B*b*log(-sin(d*x + c) + 1) + 2*A*a*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right ) \cos {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))*(A+B*sec(d*x+c)),x)

[Out]

Integral((A + B*sec(c + d*x))*(a + b*sec(c + d*x))*cos(c + d*x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 79 vs. \(2 (35) = 70\).
time = 0.46, size = 79, normalized size = 2.26 \begin {gather*} \frac {B b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - B b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + {\left (B a + A b\right )} {\left (d x + c\right )} + \frac {2 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))*(A+B*sec(d*x+c)),x, algorithm="giac")

[Out]

(B*b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - B*b*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + (B*a + A*b)*(d*x + c) + 2*A
*a*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1))/d

________________________________________________________________________________________

Mupad [B]
time = 2.19, size = 100, normalized size = 2.86 \begin {gather*} \frac {A\,a\,\sin \left (c+d\,x\right )}{d}+\frac {2\,A\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)*(A + B/cos(c + d*x))*(a + b/cos(c + d*x)),x)

[Out]

(A*a*sin(c + d*x))/d + (2*A*b*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*B*a*atan(sin(c/2 + (d*x)/2)/
cos(c/2 + (d*x)/2)))/d + (2*B*b*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d

________________________________________________________________________________________